<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"> 
  <body class="nav-md">
  <div class="">
	<div class="page-title">
	  <div class="title_left">
	    <h3>课程评论</h3>
	  </div>
	  <div class="title_right">
	  	<div class="pull-right">
	  	</div>
	  </div>
	</div>
        
    <div class="clearfix"></div>
    
    <div class="row">
       <div class="col-md-12 col-sm-12 col-xs-12">
         <div class="x_panel">
           <div class="x_title">
             <h2>评论列表</h2>
             <div class="clearfix"></div>
           </div>
           <div class="x_content">
             <table id="datatable" class="table table-striped table-bordered">
               <thead>
               <tr>
                 <th style="width: 60px">用户名</th>
                 <th style="width: 60px">用户昵称</th>
                 <th>课程</th>
                 <th>评论内容</th>
                 <th>回复内容</th>
                 <th style="width: 60px">评论时间</th>
                 <th style="width: 60px">点赞数</th>
                 <th style="width: 60px">评论状态</th>
                 <th style="width: 60px">发布状态</th>
                 <th style="width: 55px">评论操作</th>
                 <th style="width: 55px">发布操作</th>
               </tr>
               </thead>
               <tbody>
               <tr th:each="reply : ${replyList}">
                 <td th:text="${reply.userName}">用户名</td>
                 <td th:text="${reply.nickName}">昵称</td>
                 <td th:text="${reply.courseName}">课程</td>
                 <td th:text="${reply.replayContent}">评论内容</td>
                 <td th:text="${reply.teacherReply}">回复内容</td>
                 <td th:text="${reply.createdDateStr}">创建时间</td>
                 <td th:text="${reply.thumbNum}">点赞数</td>
                 <td th:text="${reply.replayStatusStr}">评论状态</td>
                 <td th:text="${reply.statusStr}">发布状态</td>
                 <td>
                   <a th:if="${reply.replayStatus} == '0'" th:onclick="'javascript:showReplyModal(\''+ ${reply.id}+'\')'" class="btn btn-primary  btn-xs"><i class="fa fa-pencil"></i> 回复</a>
                   <a th:if="${reply.replayStatus} == '1'" th:onclick="'javascript:replyBack(\''+ ${reply.id}+'\')'" class="btn btn-warning  btn-xs"><i class="fa fa-mail-reply"></i> 撤回</a>
                 </td>
                 <td>
                   <a th:if="${reply.status} == '0'" th:onclick="'javascript:publish(\''+ ${reply.id}+'\')'" class="btn btn-success  btn-xs"><i class="fa fa-toggle-on"></i> 发布</a>
                   <a th:if="${reply.status} == '1'" th:onclick="'javascript:recall(\''+ ${reply.id}+'\')'" class="btn btn-danger  btn-xs"><i class="fa fa-ban"></i> 屏蔽</a>
                 </td>
               </tr>
               </tbody>
             </table>
           </div>
         </div>
       </div>
    </div>
	</div>

  <div class="modal fad" id="replyModal" tabindex="-1" role="dialog" aria-labelledby="myModallabel">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <h4 class="modeal-title" id="myModalLabel">回复</h4>
        </div>
        <div class="modal-body">
          <div class="form-group">
            <label for="teacherReply" style="float: left; margin-left: 10%; margin-right: 3%; margin-top: 1.5%">内容：</label>
            <input type="hidden" id="replyId">
            <textarea id="teacherReply" name="teacherReply" class="form-control" style="width: 70%;"/>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
          <button type="button" class="btn btn-primary" onclick="reply()">回复</button>
        </div>
      </div>
    </div>
  </div>
  <script src="../cms/js/reply_course.js"></script>
  </body>
</html>